package Colecciones;

import Modelo.EjecutaConsulta;
import Modelo.Path;
import com.puj.bdutils.ConnectorBD;
import java.io.IOException;
import java.io.PrintStream;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

public class emplid
{
  public static synchronized String getEmplid()
    throws IOException, Exception
  {
    String v_emplid = new String();
    Statement s = null;
    Connection conn = null;
    ResultSet rs = null;
    String consulta = " SELECT emplid_last_cs  FROM sysadm.ps_installation_sa  FOR UPDATE  ";

    EjecutaConsulta.Ejecutar(consulta);

    String salida = new String();
    try
    {
      conn = ConnectorBD.getConnection(Path.ruta);
      conn.setAutoCommit(false);
      s = conn.createStatement();
      rs = s.executeQuery(consulta);
      while (rs.next())
        v_emplid = rs.getString("EMPLID_LAST_CS");
    }
    catch (Exception e) {
      s.close();
      rs.close();
      conn.close();
      System.out.println("Error : " + e);
    }
    return salida;
  }

  public static void main(String[] args)
  {
  }
}